<template>
  <a-card>
    <template #title>
      <span class="icon"></span>
      <span class="text">个人考核</span>
    </template>
    <a-list :bordered="false">
      <a-list-item v-for="(item, idx) in taskInfo" :key="idx">
        <a-list-item-meta>
          <template #title>
            <div class="title">
              <span class="icon"></span>
              <span style="font-size: 14px; font-weight: 500; color: #333">
                {{ item.title }}
              </span>
            </div>
          </template>
          <template #description>
            <a-progress
              :percent="Number(item.score)"
              :style="{ width: '380px' }"
              :color="item.color"
            />
          </template>
        </a-list-item-meta>
      </a-list-item>
    </a-list>
  </a-card>
</template>

<script lang="ts" setup>
import { ref, onMounted } from "vue";

const taskInfo = ref([]);
const fetchData = () => {
  taskInfo.value = [
    {
      title: "学校管理员发起工资发放发放审核",
      score: "0.8",
      color: "#4b8ff2",
      // score: "6/7",
    },
    {
      title: "学校管理员发起工资发放发放审核",
      score: "0.8",
      color: "#ff2c57",
    },
    {
      title: "学校管理员发起工资发放发放审核",
      score: "0.8",
      color: "#b058dd",
    },
    {
      title: "学校管理员发起工资发放发放审核",
      score: "0.8",
      color: "#b058dd",
    },
  ];
};
onMounted(() => {
  fetchData();
});
</script>

<style lang="less" scoped>
.arco-card {
  width: 100%;
  height: 300px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;

  .arco-card-body {
    display: flex;
    align-items: start !important;
    justify-content: start !important;
    overflow: auto;

    .arco-list-wrapper {
      width: 100%;
    }
  }

  .arco-card-header-title {
    display: flex;
    align-items: center;

    .icon {
      display: inline-block;
      width: 18px;
      height: 18px;
      margin-right: 8px;
      background: url("@/assets/images/考核.png") center center no-repeat;
      background-size: contain;
    }

    .text {
      font-family: SourceHanSansSCVF-Medium;
      font-size: 18px;
      font-weight: 500;
      line-height: 20px;
      color: #9caaba;
    }
  }

  /deep/.arco-list-item {
    padding: 10px !important;

    /deep/.arco-list-item-meta-content {
      width: 100% !important;

      /deep/ .arco-list-item-meta {
        width: 100% !important;
      }
    }
  }

  /deep/.arco-list-item-meta-title {
    display: flex;
    justify-content: space-between;

    .title {
      display: flex;
      align-items: center;
      justify-content: start;
      width: 300px;

      .icon {
        display: inline-block;
        width: 18px;
        height: 18px;
        margin-right: 8px;
        background: url("@/assets/images/考核.png") center center no-repeat;
        background-size: contain;
      }
    }
  }
}
</style>
